home *** CD-ROM | disk | FTP | other *** search
/ 5 Star Games: DOS Edition 2 / 5 Star Games - DOS Edition (1995)(Ready to Run).iso / dbc / db_mnu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-28  |  4.6 KB  |  130 lines

  1. /****************************************************************************/
  2. /*                 HEADER FILE FOR DATABOSS MODULE: DB_MNU                  */
  3. /****************************************************************************/
  4.  
  5. /*******************************  CONSTANTS  ********************************/
  6.  
  7. extern extstr MnuExt;  /* = ".MEN" */
  8.  
  9. #define Indicator1 16
  10. #define Indicator2 25
  11. #define QEName     "MENU"
  12. #define MnuDetSz   67
  13. #define ItmDetSz   6
  14. #define MaxMnus    255
  15. #define Up         0
  16. #define Down       1
  17. #define Vert       0
  18.  
  19. /*********************************  TYPES  **********************************/
  20.  
  21. typedef enum {InMem,OnDisk,UnForced} helpmode;
  22. typedef struct hilitebar {
  23.     bool   disp;
  24.     int    xp;
  25.     int    yp;
  26.     string savstr;
  27.     string savatr;
  28.     winptr winp;
  29. } hilitebar;
  30. typedef struct mnutyp {
  31.     byte mno;               /* Reference for user recognition */
  32.     int xm;                 /* Offset position w.r.t screen */
  33.     int ym;
  34.     byte widm;              /* Dimensions for the viewable Window Region */
  35.     byte hgtm;
  36.     byte mnucolr;           /* Window Base Color */
  37.     byte mbcolr;            /* Border Color/Attribute */
  38.     byte mshad;             /* 0-NO Shadow otherwise shadow attribute */
  39.     border mbchrs;          /* The four sides and corners of the border */
  40.     byte mtitlej;           /* Title Justification */
  41.     titlestr mtitle;        /* Title String */
  42.     byte apc;               /* Active Prompt Color */
  43.     byte ipc;               /* Inactive Prompt Color */
  44.     byte hc;                /* Highlight Character Color */
  45.     byte sl;                /* Security Level */
  46.     byte pmnu;              /* Prev menu in tree via MActTbl */
  47.     byte mtyp;
  48.     byte hbc;
  49.     winptr winp;
  50.     struct itmtyp *litm;    /* the last item accessed */
  51.     struct itmtyp *fitm;    /* first item in window (nil if none) */
  52.     struct itmtyp *hitm;    /* Hilighted Item */
  53. } mnutyp, *mnuptr;
  54. typedef struct alttyp {
  55.     uchar altcomb[4];       /* Alt Keys to activate the Item */
  56.     struct itmtyp *nxtalt;  /* Pointer for chain of all valid Alt Key sets */
  57.     struct mnutyp *parmnu;          /* To which Menu does this item belong */
  58. } alttyp;
  59. typedef struct itmtyp {
  60.     byte ix;                /* the X (column position for hilite bar */
  61.     byte iy;                /* the Y (line position for hilite bar */
  62.     byte sec;               /* Item security level */
  63.     byte prpos;             /* Prompt character to hilight */
  64.     uchar seltyp;           /* M-Menu,E-execute,NONE-no action, etc. */
  65.     byte editsec;           /* Editable security */
  66.     strptr selpath;         /* Path to change to when executing a program */
  67.     strptr selact;          /* activity win#, item# or file names */
  68.     uchar selwait;          /* [Y/N] to wait after Exec'ing a program */
  69.     strptr selcmd;          /* possible command line parameters for SelAct */
  70.     strptr prompt;          /* Item Prompt */
  71.     alttyp altern;          /* Alt Keys to activate the Item */
  72.     winptr helpwin;         /* Pointer to the Help Window */
  73.     struct itmtyp *nitm;    /* the next item (nil if none */
  74.     struct itmtyp *pitm;    /* the prev item (nil if none */
  75. } itmtyp, *itmptr;
  76. typedef mnuptr macttbl[MaxMnus];
  77. typedef struct mnufrec {
  78.     pathstr mnufnam;
  79.     winptr basewin1;
  80.     winptr basewin2;
  81.     hilitebar hb;
  82.     macttbl mat;
  83.     struct mnutyp *curmnu;
  84.     struct itmtyp *curitm;
  85.     int level;
  86.     int dx;
  87.     int dy;
  88.     struct itmtyp *altcomb1;
  89.     set mnualtset;
  90.     byte scrmode;
  91.     helpmode wherehelp;
  92.     int mactfil;
  93.     bool mactopen;
  94.     word savattr;
  95. } mnufrec;
  96. typedef void (*actionproc)(mnufrec *m, itmptr itm);
  97.  
  98. /*************************  INITIALIZED VARIABLES  **************************/
  99.  
  100. extern bool FINE;            /* = False  */
  101.  
  102. /*******************************  VARIABLES  ********************************/
  103.  
  104. extern bool     stophelp;
  105. extern helpmode forceh;
  106. extern byte     backjump;
  107. extern byte     esecurity;
  108.  
  109. /*******************************  PROTOTYPES  *******************************/
  110.  
  111. void itemhelp(mnufrec *m);
  112. void disposemnus(mnufrec *m);
  113. void processalt(uchar ach, mnufrec *m, actionproc do_proc);
  114. void initmnu(mnufrec *m, byte s, byte n, helpmode whereh);
  115. void dspmnu(mnufrec *m, mnuptr mnu);
  116. void zapmnu(mnufrec *m, mnuptr mnu);
  117. bool selitm(uchar letter, mnufrec *m);
  118. itmptr traceup(mnufrec *m, mnuptr cm, int fm);
  119. bool inmchain(mnufrec *m, byte pm);
  120. void firstitm(mnufrec *m);
  121. void lastitm(mnufrec *m);
  122. void goud(mnufrec *m, int dirn);
  123. void gorl(mnufrec *m, int dirn);
  124. void jumptomnu(mnufrec *m, byte mno);
  125. void hbar(mnufrec *m);
  126.  
  127. void db_mnu_init(void);
  128.  
  129. /****************************** END OF DB_MNU.H *****************************/
  130.